﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MammothMicro.SmtpGuardFilter.Common;

namespace MammothMicro.SMTPGuard.Common
{
    public interface IMailStore
    {
        /// <summary>
        /// Save email to repository
        /// </summary>
        /// <param name="message"></param>
        void Save(SerializableMailMessage message );
        /// <summary>
        /// Get 1 email from the repository
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        SerializableMailMessage Get(Guid id);
        /// <summary>
        /// Get list f messages for single recipient
        /// </summary>
        /// <param name="recipient"></param>
        /// <returns></returns>
        List<SerializableMailMessage> Get(string recipient); 
        /// <summary>
        /// Get list of messages for one recipient
        /// </summary>
        /// <param name="recipient"></param>
        /// <param name="lastDays"></param>
        /// <returns></returns>
        List<SerializableMailMessage> Get(string recipient, int lastDays);
        /// <summary>
        /// Delete 1 email
        /// </summary>
        /// <param name="id"></param>
        void Delete(Guid id);
        /// <summary>
        /// Delete all emails from recipient
        /// </summary>
        /// <param name="recipient"></param>
        void Delete(string recipient);
        /// <summary>
        /// Deletes emails for 1 user older than number of days
        /// </summary>
        /// <param name="recipient"></param>
        /// <param name="olderThanDays"></param>
        void Delete(string recipient, int olderThanDays);

    }
}
